<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>hello world</title>
    <style type="text/css">
    [v-cloak]{
        display: none;
    }
    </style>
  </head>
  <body>
    <div id="app">
      <div v-cloak>{{ num }}</div>
      <div>
        <button v-on:click='num++'>点击+1</button>
        <button @click='num++'>点击+1</button>
        <button v-on:click='handle'>点击+1</button>
        <button v-on:click='handle()'>点击+1</button>
      </div>
    </div>

    <script type="text/javascript" src="js/vue.js"></script>
    <script type="text/javascript">
      var vm = new Vue({
        el: '#app',
        data: {
          num: 0,
        },
        methods: {
          handle: function(){
            //这里的this是vue的实例对象
            console.log(this === vm);
            this.num++;
          },
        },
      });
    </script>
  </body>
</html>
